package com.gitee.wsl.compose.mvi.router.slot

import com.gitee.wsl.compose.mvi.router.RouteNode
import com.gitee.wsl.compose.mvi.router.Router


 data class Slot<out C : Any>(
    val active: RouteNode<C>? = null,
)

 class SlotRouter<R : Any>(name: String) : Router<TransformSlot<R>>(name)

 typealias TransformSlot<R> = (active: R?) -> R?

 fun <R : Any> SlotRouter<R>.set(active: R?) {
    route { _ -> active }
}

 fun <R : Any> SlotRouter<R>.clear() {
    route { _ -> null }
}